﻿
@model  IEnumerable<Developer.Entity.RepairColor>

@{
    ViewBag.Title = "RepairBrand";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    var i = 1;
}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 维修管理 <span class="c-gray en">&gt;</span> 手机型号列表 <a class="btn btn-success radius r" id="btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <label>细分品牌：</label>
        <select name="" id="brand" style="height: 29px;" onchange="window.location=this.value;">
            @{
                var brands = Developer.Service.RepairBrandService.GetAll().Where(a => a.IsAbort == false);
                <option>选择品牌</option>
                foreach (var brand in brands)
                {
                    <option value="/admin/statistic/RepairBrandDetail?bid=@brand.Id">@brand.Name</option>
                }

            }
        </select>
    </div>
    <div class="mt-20">

        <div id="container" style="min-width:700px;height:400px"></div>
        <div style="clear:both;"></div>
    </div>
</div>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/highcharts.js"></script>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/modules/exporting.js"></script>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/highcharts-3d.js"></script>

<script type="text/javascript">
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'pie',
                options3d: {
                    enabled: true,
                    alpha: 45,
                    beta: 0
                }
            },
            title: {
                text: '[维修]品牌详细型号访问记录饼图'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    depth: 35,
                    dataLabels: {
                        enabled: true,
                        format: '{point.name}'
                    }
                }
            },
            series: [{
                type: 'pie',
                name: '型号',
                data: [
                    @{
                        string array = string.Empty;

                        foreach(var color in Model)
                        {

                            array += "['" + color.RepairModel.RepairBrand.Name + color.RepairModel.Name + color.Name + "'," + color.Statistic + "],";
                        }
                    }
                    @Html.Raw(array)
                ]
            }]
        });
    });
</script>
<script>
   
</script>